package
{
	import flash.display.*;
	import flash.events.MouseEvent;
	import fl.data.DataProvider;
	import fl.controls.ComboBox;
	import fl.controls.CheckBox;
	import fl.controls.TextInput;
	import fl.controls.TextArea;
	import fl.controls.Button;
	import fl.controls.DataGrid;
	import fl.controls.dataGridClasses.DataGridColumn;
	import flash.events.*;
	import fl.events.DataChangeEvent;
	import flash.desktop.NativeApplication;
	
	public class TimerSubmit extends MovieClip
	{
		public static var myParent:MovieClip;

		private var dateInput:TextInput;
		private var timeInput:TextInput;
		private var clientInput:ComboBox;
		private var projectInput:ComboBox;
		private var moduleInput:ComboBox;
		private var taskInput:ComboBox;
		private var workTypeInput:ComboBox;
		private var billableInput:CheckBox;
		private var descriptionInput:TextArea;
		
		public function TimerSubmit()
		{
			var X = 80;

			dateInput = new TextInput();
			dateInput.x = X;
			dateInput.y = 30;
			this.addChild(dateInput);

			timeInput = new TextInput();
			timeInput.x = X;
			timeInput.y = 60;
			this.addChild(timeInput);

			clientInput = new ComboBox();
			clientInput.x = X;
			clientInput.y = 90;
			clientInput.width = 360;
			this.addChild(clientInput);

			projectInput = new ComboBox();
			projectInput.x = X;
			projectInput.y = 120;
			projectInput.width = 360;
			this.addChild(projectInput);

			moduleInput = new ComboBox();
			moduleInput.x = X;
			moduleInput.y = 150;
			moduleInput.width = 360;
			this.addChild(moduleInput);

			taskInput = new ComboBox();
			taskInput.x = X;
			taskInput.y = 180;
			taskInput.width = 360;
			this.addChild(taskInput);

			workTypeInput = new ComboBox();
			workTypeInput.x = X;
			workTypeInput.y = 210;
			workTypeInput.width = 360;
			this.addChild(workTypeInput);

			billableInput = new CheckBox();
			billableInput.x = X;
			billableInput.y = 240;
			billableInput.label = '';
			this.addChild(billableInput);

			descriptionInput = new TextArea();
			descriptionInput.x = 10;
			descriptionInput.y = 270;
			descriptionInput.width = 430;
			descriptionInput.height = 90;
			this.addChild(descriptionInput);

			this.dragBar.addEventListener(MouseEvent.MOUSE_DOWN, drag_me, false, 0, true);
			this.cancel_button.addEventListener(MouseEvent.CLICK, hideSettings, false, 0, true);
			this.submit_button.addEventListener(MouseEvent.CLICK, submitTimer, false, 0, true);
		}

		function submitTimer(e:MouseEvent):void
		{
			
		}

		function hideSettings(e)
		{
			this.parent.removeChild(e.target.parent);
		}
		
		function drag_me(e:MouseEvent)
		{
			stage.nativeWindow.startMove();
		}

		public static function get_myParent()
		{
			return myParent;// = p;
		}
	}
}